﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Mathmall.Administration.Migrations
{
    /// <inheritdoc />
    public partial class AddMenuAndRoleMenuTable : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Menu",
                columns: table => new
                {
                    MenuId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    菜单名称 = table.Column<string>(type: "varchar(256)", nullable: false, comment: "菜单名称"),
                    菜单编码 = table.Column<int>(type: "int", nullable: false, comment: "菜单编码"),
                    父节点id = table.Column<int>(type: "int", nullable: false, comment: "父节点id"),
                    节点类型 = table.Column<string>(type: "varchar(256)", nullable: true, comment: "节点类型"),
                    url = table.Column<string>(type: "varchar(1000)", nullable: true, comment: "url"),
                    节点层级 = table.Column<int>(type: "int", nullable: false, comment: "节点层级"),
                    路径 = table.Column<string>(type: "varchar(256)", nullable: true, comment: "路径"),
                    Operation = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("菜单id", x => x.MenuId);
                },
                comment: "菜单");

            migrationBuilder.CreateTable(
                name: "RoleMenu",
                columns: table => new
                {
                    RoleId = table.Column<int>(type: "int", nullable: false),
                    MenuId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Menu");

            migrationBuilder.DropTable(
                name: "RoleMenu");
        }
    }
}
